package com.go.dp.strategy.one;

public class Dog implements Comparable{
	public Dog(int height, int weight) {
		this.height = height;
		this.weight = weight;
	}

	private int height;

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

	private int weight;

	@Override
	public String toString() {
		return "[" + this.height + "|" + this.weight + "]";
	}

	public int compareTo(Dog dog) {
		if (this.height > dog.height)
			return 1;
		else if (this.height < dog.height)
			return -1;
		else
			return 0;
	}

	@Override
	public int compareTo(Object o) {
		if (this.height > ((Dog)o).getHeight())
			return 1;
		else if (this.height < ((Dog)o).getHeight())
			return -1;
		else
			return 0;
	}
}
